@import (reference) './../../../common/css/mixin.module.less';

ul,
li,
p,
img {
  margin: 0;
  padding: 0;
}

ul, li {
  list-style-type: none;
}

.session-context {
  padding: 0 50px;
  height: 100%;
  overflow-x: hidden;

  .message-item {
    margin-top: 20px;

    &:first-child {
      margin-top: 0;
    }
  }

  .chat-item-box {
    .flex-horizontal();

    .avatar-image {
      flex-shrink: 0;
      margin-right: 12px;
      width: 56px;
      height: 56px;
    }
  }

  .chat-item-right {
    width: calc(100% - 68px);

    .chat-item-answer {
      padding: 10px;
      font-size: 14px;
      font-weight: 400;
      font-family: PingFang SC;
      color: #000;
      border-radius: 8px;
      background-color: #fff;

      .attachment-list-wrapper {
        position: relative;
        margin: 20px 0 16px;

        .attachment-grid {
          .flex-horizontal();
          flex-wrap: wrap;
          align-items: center;
          gap: 12px;
          height: 48px;
          overflow: hidden;

          &.expand {
            height: unset;
          }

          .attachment-item {
            flex: 0 0 auto;
            .flex-horizontal(@align-items: center);
            gap: 6px;
            width: calc((100% - 12px * 3) / 4);
            height: 48px;
            overflow: hidden;
            background: #f5f5f5;
            padding: 7px 10px;
            border-radius: 8px;
            word-break: break-all;
            cursor: pointer;

            .item-name {
              display: -webkit-box;
              overflow: hidden;
              line-clamp: 2;
              -webkit-line-clamp: 2;
              -webkit-box-orient: vertical;
              text-overflow: ellipsis;
            }
          }
        }

        .attachment-collapse-button {
          display: block;
          margin: 15px auto 0;
          padding: 2px 30px;

          &.collapse {
            display: none;
          }
        }
      }

      .answer-generate-type {
        margin-top: 5px;
        padding: 12px 0 0;
        font-size: 14px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #8890a5;
        border-top: 1px solid #f0f0f0;
      }

      .paragraph-slice-list-wrapper {
        .flex-horizontal();
        margin-top: 12px;
        padding-top: 20px;
        border-top: 1px solid #f0f0f0;

        .list-title {
          flex: 0 0 auto;
          padding: 5px 5px 0 0;
          font-weight: 500;
          color: #333;
          white-space: nowrap;
        }

        .paragraph-slice-list {
          .flex-horizontal();
          flex-wrap: wrap;
        }

        .paragraph-slice-item {
          flex: 0 0 auto;
          margin: 0 4px 8px;
          padding: 5px 12px;
          font-weight: 500;
          color: #2b47e6;
          text-align: justify;
          border-radius: 8px;
          background-color: #2d49e61f;
          cursor: pointer;

          &:last-of-type {
            margin-right: 0;
          }
        }

        .show-more {
          flex: 0 0 auto;
          margin: 0px 4px 8px;
          padding: 4px 12px;
          height: 30px;
          border-radius: 8px;
          background-color: #eee;
        }
      }

      .feedback {
        .flex-horizontal();
        margin-top: 10px;

        &.feedback-first {
          padding-top: 10px;
          border-top: 1px solid #f0f0f0;
        }

        &-name {
          flex-shrink: 0;
          padding-right: 10px;
        }
      }
    }

    .file-corridor {
      .flex-horizontal();
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
      margin-top: 10px;
      padding: 0 10px;

      .file-item-wrapper {
        .flex-horizontal();
        align-items: center;
        gap: 6px;
        padding: 7px 10px;
        border-radius: 8px;
        background-color: #3e5bff08;
        word-break: break-all;

        &.file-doc-wrapper {
          height: 56px;
        }
      }

      .file-item-image {
        max-width: 160px;
        max-height: 160px;
      }
    }
  }

  :global {
    .refer-btn {
      display: inline-block;
      margin: 0 1px;
      padding: 0 5px;
      font-size: 12px;
      color: #2b47e6;
      vertical-align: super;
      border-radius: 4px;
      background-color: #2d49e61f;
      cursor: pointer;
    }
  }
}
